package pack1;
class X extends Y{
    Y y=new Y();
    public X(){
        System.out.print("X");
    }
}
class Y{
    public Y(){
        System.out.print("Y");
    }
    public void fun(){
        System.out.println("Y的成员方法");
    }
}
public class Z extends X{
    Y y=new Y();

    public Z(){
        System.out.print("Z");
    }


    public static void main(String[] args) {
         Z z =new Z();
         new X().fun();
    }

}
